home *** CD-ROM | disk | FTP | other *** search
- Path: news.uni-stuttgart.de!schweikh
- From: schweikh@itosun.ito.uni-stuttgart.de (Jens Schweikhardt)
- Newsgroups: comp.lang.c
- Subject: Re: prefix vs. postfix
- Date: 4 Jan 1996 09:52:01 GMT
- Organization: Comp.Center (RUS), U of Stuttgart, FRG
- Message-ID: <4cg801$1f8u@info4.rus.uni-stuttgart.de>
- References: <00001a80+00006591@msn.com> <4cegko$20s@ixnews5.ix.netcom.com>
- NNTP-Posting-Host: itosun.ito.uni-stuttgart.de
-
- In article <4cegko$20s@ixnews5.ix.netcom.com>,
- Andrew Snyder <a1s@ix.netcom.com> wrote:
- >RNorman@msn.com (Richard Norman) wrote:
- >
- >>Am I the only one in the world who writes loops as:
- >> for (i=0; i<i_max; ++i) ...?
- >>
- >>Note the prefix, ++i. Virtually all the program examples I see
- >>use the postfix, i++.
-
- No, you are not the only one. I use ++i too,
- years ago I was programming in assembler,
- I find it helpful to read '++' as 'increment'
- and '--' as 'decrement'. Even if you are scared
- by such techno-babble, pronounce '++' as 'add one to'
- and you know why I have difficulties parsing i++.
- Which reads "I add one to." "You add to what?" :-)
-
- I don't have my K&R handy, but could it be the examples
- there mostly use i++ when only the side effects are
- wanted?
-
- Bye, Jens
- --
- SIGSIG -- signature too long (core dumped)
-